//该文件专门用于创建整个应用的路由器
import VueRouter from "vue-router";
//引入组件
import Home from '../views/Home'
import HelloWorld from "@/components/HelloWorld";
import All from "@/views/All";
import TuShu from "@/views/TuShu";
import FuShi from "@/views/FuShi";

//创建并暴露一个路由器
export default  new VueRouter({
    routes: [
        {
            path: "/",
            redirect:"/hello"
        },
        {
            path: "/hello",
            component: HelloWorld,
        },
        {
            path: "/home",
            component: Home,
            children: [
                {
                    path: "all",
                    component: All,
                },
                {
                    path: "tushu",
                    component: TuShu,
                },
                {
                    path: "fushi",
                    component: FuShi,
                },
            ],
        },
    ],
});

